package gospinner

// Animation in the terminal.
type Spinner struct {
	// Custom data.
	Data []interface{}
	// Execution after Spinner.Frame.
	Defer func()
	// Implementation of animation.
	Frame func(s Spinner)
	// Animation elements.
	Gens [][]func(data ...interface{}) string
}

// Start animation.
func (s Spinner) Start() {
	if s.Defer != nil {
		defer s.Defer()
	}

	if s.Frame != nil {
		s.Frame(s)
	}
}
